import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'sign',
    component: () => import("../views/sign.vue")
  },
  {
    path: '/layout',
    name: 'layout',
    component: () => import(/* webpackChunkName: "about" */ '../views/layout.vue'),
    redirect: "/login",
    children: [
      {
        path: '/login',
        name: 'login',
        meta: { title: "首页" },
        component: () => import("../views/login.vue")
      },
      {
        path: '/list',
        name: 'list',
        meta: { title: "列表" },
        component: () => import("../views/list.vue")
      }, {
        path: '/car',
        name: 'car',
        meta: { title: "购物车" },
        component: () => import("../views/car.vue")
      }, {
        path: '/my',
        name: 'my',
        meta: { title: "我的" },
        component: () => import("../views/my.vue")
      },
    ]
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
